export default [
    {
      path: '/index',
      name: 'index',
      component: () => import('../views/Index.vue'),
      children:[
        {
            path: '/index/home',
            name: 'home',
            component: () => import('../views/Index/Home.vue'),
        },
        {
            path: '/index/order',
            name: 'order',
            component: () => import('../views/Index/Order.vue'),
        },
        {
            path: '/index/mine',
            name: 'mine',
            component: () => import('../views/Index/Mine.vue'),
        },
        {
            path: '/index/Bao',
            name: 'Bao',
            component: () => import('../views/Index/Bao.vue'),
        },
        {
            path: '/index',
            redirect: '/index/home'//重定向
        },
        // 对于嵌套路由的404路由, 一定要在路由地址前加上 上一级路由的地址
        {
            path:'/index/:error(.*)',
            component: () => import('../views/NotFound.vue')
        }
      ]
    },
    {
      path: '/about',
      name: 'about',
      component: () => import('../views/About.vue')
    },
    {
      path: '/',
      redirect: '/index'//重定向
    },
    // 404路由
    {
        path:'/:error(.*)', //必须写成 正则的语法
        component: () => import('../views/NotFound.vue')
    }
]